package lol.clann.minecraft.springboot.api.bukkit.event;

import org.bukkit.Chunk;
import org.bukkit.entity.Player;
import org.bukkit.event.Cancellable;
import org.bukkit.event.HandlerList;
import org.bukkit.event.player.PlayerEvent;

/**
 *
 * @author pyz
 * @date 2019/6/22 10:29 AM
 */
public class PlayerChangeChunkEvent extends PlayerEvent implements Cancellable {
    private static final HandlerList handlers = new HandlerList();
    private boolean cancel = false;
    private Chunk from;
    private Chunk to;

    public PlayerChangeChunkEvent(Player player, Chunk from, Chunk to) {
        super(player);
        this.from = from;
        this.to = to;
    }

    @Override
    public boolean isCancelled() {
        return this.cancel;
    }

    @Override
    public void setCancelled(boolean cancel) {
        this.cancel = cancel;
    }

    public Chunk getFrom() {
        return this.from;
    }

    public Chunk getTo() {
        return this.to;
    }

    @Override
    public HandlerList getHandlers() {
        return handlers;
    }

    public static HandlerList getHandlerList() {
        return handlers;
    }
}
